.notice {
	display: flex;
		flex-direction: column;
	position: relative;
	width: 100%;
	margin-bottom: 24px;
	background: lighten( $gray, 30 );
	box-sizing: border-box;
	animation: appear .3s ease-in-out;

	@include breakpoint( ">480px" ) {
		flex-direction: row;
	}

	// Success!
	&.is-success {
		background: $alert-green;
	}

	// Warning
	&.is-warning {
		background: $alert-yellow;
	}

	// Error! OHNO!
	&.is-error {
		background: $alert-red;
	}

	// General notice
	&.is-info {
		background: $blue-wordpress;
	}

	&.is-success,
	&.is-error,
	&.is-warning,
	&.is-info {
		color: $white;

		.notice__text a {
			color: $white;
		}

		.notice__dismiss {
			color: $white;
		}
	}
}

.notice__icon {
	position: absolute;
		top: 0;
		left: 0;
	display: flex;
		flex-shrink: 0;
	width: 18px;
	height: 18px;
	padding: 14px 16px;

	@include breakpoint( ">480px" ) {
		position: relative;
		padding: 13px 0px 13px 16px;
		width: 24px;
		height: 24px;
	}
}

.notice__content {
	display: flex;
		flex-grow: 1;
	padding: 14px 48px;
	font-size: 12px;

	@include breakpoint( ">480px" ) {
		font-size: 14px;
		padding: 13px;
	}
}

.notice__text {
	max-width: 680px;

	a {
		text-decoration: underline;
	}

	ul {
		margin-bottom: 0;
		margin-left: 0;
	}

	li {
		margin-left: 2em;
		margin-top: 0.5em;
	}

	p {
		margin-bottom: 0;
		margin-top: 0.5em;

		&:first-child {
			margin-top: 0;
		}
	}
}

.notice__button {
	cursor: pointer;
	margin-left: 0.428em;
}

// "X" for dismissing a notice
.notice__dismiss {
	position: absolute;
		top: 0;
		right: 0;
	display: flex;
		flex-shrink: 0;
	padding: 14px 16px;
	cursor: pointer;
	color: $gray;

	.gridicon {
		width: 18px;
		height: 18px;
	}

	@include breakpoint( ">480px" ) {
		position: relative;
		padding: 13px 16px;

		.gridicon {
			width: 24px;
			height: 24px;
		}
	}

	&:hover,
	&:focus {
		color: $gray-dark;
	}

	.notice & {
		color: $gray;
		opacity: 0.85;

		&:hover,
		&:focus {
			opacity: 1;
		}
	}
}

// specificity for general `a` elements within notice is too great
a.notice__action {
	display: flex;
		justify-content: center;
		flex-shrink: 0;
		flex-grow: 1;
	box-sizing: border-box;
	margin: 0 8px 8px 8px;
	padding: 8px;
	border-radius: 3px;
	cursor: pointer;
	font-size: 12px;
	font-weight: 400;
	text-decoration: none;
	white-space: nowrap;
	background: lighten( $gray, 28 );

	@include breakpoint( ">480px" ) {
			flex-shrink: 1;
			flex-grow: 0;
		align-items: center;
		border-radius: 0;
		font-size: 14px;
		margin: 0 0 0 auto; // forces the element to the right;
		padding: 13px 16px;

		.gridicon {
			width: 24px;
			height: 24px;
		}
	}

	.is-success &,
	.is-error &,
	.is-warning &,
	.is-info & {
		color: $white;
	}

	.is-success & { background: darken( $alert-green, 15 ); }
	.is-error & { background: darken( $alert-red, 15 ); }
	.is-warning & { background: darken( $alert-yellow, 15 ); }
	.is-info & { background: darken( $blue-wordpress, 15 ); }

	.gridicon {
		margin-left: 8px;
		opacity: 0.7;
		width: 18px;
		height: 18px;
	}

	&:hover,
	&:focus {
		background: rgba( 255, 255, 255, 0.2 );
	}
}

// Compact notices
.notice.is-compact {
	display: inline-flex;
		flex-wrap: nowrap;
		flex-direction: row;
	width: auto;
	border-radius: 2px;
	min-height: 20px;
	margin: 0;
	padding: 0;
	text-decoration: none;
	text-transform: none;
	vertical-align: middle;

	&.is-success,
	&.is-error,
	&.is-warning,
	&.is-info {
		color: $white;
	}

	.notice__content {
		font-size: 12px;
		padding: 6px 8px;
	}

	.notice__text {
		line-height: 1;
	}

	.notice__icon {
		position: relative;
		align-self: center;
		flex-shrink: 0;
		margin: 0 0 0 8px;
		padding: 0;
		width: 18px;
		height: 18px;
		vertical-align: middle;
	}

	.notice__dismiss {
		display: none;
	}

	a.notice__action {
		background: transparent;
		display: inline-block;
		margin: 0;
		font-size: 12px;
		font-weight: 600;
		align-self: center;
		margin-left: 16px;
		padding: 0 8px;
		text-decoration: underline;
		text-transform: uppercase;

		&:hover,
		&:active,
		&:focus {
			background: transparent;
			text-decoration: none;
		}

		.gridicon {
			margin-left: 8px;
			width: 14px;
			height: 14px;
			vertical-align: sub;
			opacity: 1;
		}
	}
}
